package top.kaoshanji.p1ch02b;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 代码清单-p1ch02b-40页a：使用CommandLineRunner输出
 * @author kaoshanji
 * ^_^
 * create time 2025/5/19 15:06
 */
@Slf4j
@Configuration
public class CommandLineRunnerContext {

    @Autowired
    private MySqlProperties mySqlProperties;

    @Autowired
    private JavastackProperties javastackProperties;

    @Autowired
    private OtherMember otherMember;

    @Bean
    public CommandLineRunner commandLineRunner() {
        return (args ) -> {
            log.info("...mySqlProperties: {}", mySqlProperties);
            log.info("...javastack properties: {}", javastackProperties);
            log.info("...otherMember properties: {}", otherMember);
        };
    }

}
